﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework;

namespace MenuGame2DXNA
{
    public class sHelp : Scene
    {
        GroupLayout textbox;
        Dialog dialog;
        KeyboardState oldState;
        Game game;
        public override void LoadContent(Game _game)
        {
            game = _game;
            base.LoadContent(game);

            textbox = new GroupLayout(game.Content, "LayoutHelp.xml", "");
            textbox.PositionStart = new Vector2(100, 150);
            textbox.TopLeft = new Vector2(-900, -600);
            dialog = new Dialog(game, 600, 450, textbox, "HELPS");
            Stop();
        }
        public override void Update(Microsoft.Xna.Framework.GameTime gameTime)
        {
            if (!isPlayMusic)
            {
                MusicManager.Play("Title");
                isPlayMusic = true;
            }
            KeyboardState kbState = Keyboard.GetState();
            if (kbState.IsKeyDown(Keys.Escape))
            {
                game.Scene = 0;
                Stop();
            }
           
            dialog.Update(gameTime, Color.White);
        }
        public override void Draw(Microsoft.Xna.Framework.GameTime gameTime, Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
        {

            base.Draw(gameTime, spriteBatch);
            dialog.Draw(gameTime, spriteBatch);
        }
        public override void Play()
        {
            dialog.Appear(54);
            base.Play();
        }
        public override void Stop()
        {
            dialog.DisAppear(1);
            base.Stop();
        }

    }
}
